package toanstt.com;

import android.graphics.Canvas;

public class Dialog
{
	int time_in = 5;
	int time_on = 10;
	int time_out = 5;
	int curenttime = 0;
	float alpha;
	String string = "TOan";
	public Dialog()
	{
		
	}
	public void Draw(Canvas canvas)
	{
		
		if(curenttime==0)
			return;
		if(curenttime>15)
		{
			alpha = (5-(curenttime-15))*1.0f/5;
			T.bitmapFont[4].paint.setAlpha(((int)(alpha*255)));
		}
		else if(curenttime>5)
			T.bitmapFont[4].paint.setAlpha(255);
		else
		{
			alpha = (curenttime)*1.0f/5;
			T.bitmapFont[4].paint.setAlpha((int)(alpha*255));
		}
		curenttime--;
		T.bitmapFont[4].drawString(canvas, string, T.GAME_SCREEN_WIDTH/2, T.GAME_SCREEN_HEIGHT/2, 2);
		T.bitmapFont[4].paint.setAlpha(255);
	}
	public void DoDialog(String a)
	{
		string = a;
		curenttime = 20;
	}
}
